<%@ page import="service.RainService" %>
<%@ page import="service.Impl.RainServiceImpl" %>
<%@ page import="java.util.List" %>
<%@ page import="entity.Rainquality" %><%--
  Created by IntelliJ IDEA.
  User: 铃
  Date: 2024/9/18
  Time: 10:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    response.setContentType("text/html;charset=UTF-8");
    String contextpath= request.getContextPath();
    RainService rainService=new RainServiceImpl();
    Rainquality rainquality=new Rainquality();
    String opr=request.getParameter("opr");
    if ("getAll".equals(opr)){
        List<Rainquality> list=rainService.getAll();
        application.removeAttribute("list");
        application.setAttribute("list",list);
        response.sendRedirect(contextpath+"/index.jsp");
        return;
    }else {
        rainService.del(opr);
        out.print("<script>alert('删除成功!');location.href='"+contextpath+"/index.jsp'</script>");
    }
%>
</body>
</html>
